// 疾病记录类型
export interface DiseaseRecord {
  date: string;
  description: string;
}

// 影像检查结果类型
export interface ImagingResult {
  type: string;
  date: string;
  result: string;
}

// 实验室检查结果类型
export interface LabResultItem {
  value: number;
  unit: string;
  date: string;
  reference_range: string;
}

export interface LabResults {
  blood_uric_acid: LabResultItem;
  creatinine: LabResultItem;
}

// 随访计划类型
export interface FollowUpPlan {
  followup_type: string[];
  next_follow_up: string;
}

// 随访记录类型
export interface FollowUpRecord {
  date: string;
  status: string;
  description: string;
}
// 新增基础信息类型
export interface PatientBasicInfo {
  patient_id: string;
  name: string;
  idcard: string;
  status: string;
  gender: string;
  age: number;
  first_flag: string;
  clinical_date: string;
  medical_record_number: string;
  telephone: string; // 注意字段名是telephone不是phone
  clinical_type: string; // 门诊/住院
}
// 修正后的Patient类型
export interface Patient {
  basic_info: PatientBasicInfo; // 关键修正点
  disease_records: DiseaseRecord[];
  imaging_results: ImagingResult[];
  lab_results: LabResults;
  follow_up_plan: FollowUpPlan;
  follow_up_records: FollowUpRecord[];
  emergency_records: EmergencyRecord[]; // 复数形式表示数组
}

// 患者数据响应类型
export interface PatientsData {
  patients: Patient[];
}

// 新增独立急诊记录类型
export interface EmergencyMedicalRecord {
  patient_id: string;
  medical_records: {
    diagnosis: string;
    main_symptoms: string;
    treatment_plan: string[];
    prescriptions: Prescription[];
    recurrency: number[];
    uric_acid_levels: {
      current: string;
      trend: string;
      is_miss_drug: string;
      is_change_drug: string;
      is_recurrency: string;
      time_frame: string;
    }
  }
}

export interface Prescription {
  drug_name: string;
  specification: string;
  usage: string;
  duration: string;
  status: '进行中' | '已完成' | '漏服';
}

